//
//  DMMessageBaseCellTableViewCell.h
//  HDMainWindow
//
//  Created by apple on 2017/5/3.
//  Copyright © 2017年 com.devin.definesys. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DMMessageBaseModel.h"
#import "LLMessageCellActionDelegate.h"

//聊天界面的框，占屏幕的百分比
#define CHAT_BUBBLE_MAX_WIDTH_FACTOR 0.58

//Avatar和SuperView之间的约束
#define AVATAR_SUPER_LEFT 10
#define AVATAR_SUPER_TOP 0
#define AVATAR_WIDTH 45
#define AVATAR_HEIGHT 45

//Bubble上下左右的空白量
#define BUBBLE_LEFT_BLANK 7
#define BUBBLE_RIGHT_BLANK 7
#define BUBBLE_TOP_BLANK 2
#define BUBBLE_BOTTOM_BLANK 11

#define BUBBLE_MASK_ARROW 6.5

//Bubble的约束
#define CONTENT_AVATAR_MARGIN 3
#define CONTENT_SUPER_BOTTOM 20
#define CONTENT_SUPER_TOP AVATAR_SUPER_TOP

#define HIDE_STATUS_BUTTON _statusButton.hidden = YES

#define SHOW_STATUS_BUTTON self.statusButton.hidden = NO

#define HIDE_INDICATOR_VIEW _indicatorView.hidden = YES; [_indicatorView stopAnimating]

#define SHOW_INDICATOR_VIEW self.indicatorView.hidden = NO; [_indicatorView startAnimating]

//这个距离Cell和bubble之间的间隔
#define ACTIVITY_VIEW_X_OFFSET 5

extern UIImage *ReceiverTextNodeBkg;
extern UIImage *ReceiverTextNodeBkgHL;
extern UIImage *SenderTextNodeBkg;
extern UIImage *SenderTextNodeBkgHL;

extern UIImage *ReceiverImageNodeBorder;
extern UIImage *ReceiverImageNodeMask;
extern UIImage *SenderImageNodeBorder;
extern UIImage *SenderImageNodeMask;

@interface DMMessageBaseCell : UITableViewCell {
    @protected
    UIActivityIndicatorView *_indicatorView;
    UIButton *_statusButton;
    UIImageView *_selectControl;
}

//组件,给子类使用
@property (nonatomic) UIImageView *avatarImage;
@property (nonatomic) UIImageView *bubbleImage;
@property (nonatomic) UIActivityIndicatorView *indicatorView;
@property (nonatomic) UIButton *statusButton;
@property (nonatomic) UIImageView *selectControl;

@property (nonatomic) DMMessageBaseModel *messageModel ;

@property (nonatomic, weak) id<LLMessageCellActionDelegate> delegate;

+ (CGFloat)heightForModel:(DMMessageBaseModel *) model ;

- (void)showMenuControllerInRect:(CGRect)rect inView:(UIView *)view ;

- (NSArray<NSString *> *)menuItemNames ;

- (NSArray<NSString *> *)menuItemActionNames ;

- (void)prepareForUse ;

@end

